package com.ym.medical.service.impl;

import com.ym.core.utils.tkmybatis.BaseSVImpl;
import com.ym.medical.dao.StandarTaglibraryDao;
import com.ym.medical.domain.entity.StandarTaglibraryEntity;
import com.ym.medical.domain.param.StandarTaglibraryQueryParam;
import com.ym.medical.domain.param.StandarTaglibraryUpdateParam;
import com.ym.medical.domain.vo.StandarTaglibraryListPcVO;
import com.ym.medical.service.IStandarTaglibrarySV;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
                                        
/**
* 标准标签库Service业务层处理
*
* @author ym
* @date 2020-08-20
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class StandarTaglibrarySVImpl extends BaseSVImpl<StandarTaglibraryEntity,StandarTaglibraryDao> implements IStandarTaglibrarySV {

	/**
	 * 查询标准标签库列表
	 *
	 * @param queryParam 标准标签库 查询参数
	 * @return 标准标签库
	 */
	@Override
	public List<StandarTaglibraryListPcVO> selectListPC(StandarTaglibraryQueryParam queryParam) {
		List<StandarTaglibraryListPcVO> standarTaglibrarys = mapper.selectListPC(queryParam);
		return standarTaglibrarys;
	}

	/**
	 * 新增标准标签库
	 *
	 * @param updateParam 标准标签库 新增参数
	 * @return 结果
	 */
	@Override
	public Long insertPC(StandarTaglibraryUpdateParam updateParam) {
            StandarTaglibraryEntity entity = updateParam.covert();
		this.insert(entity);
		return entity.getId();
	}

	/**
	 * 修改标准标签库
	 *
	 * @param updateParam 标准标签库 修改参数
	 * @return 结果
	 */
	@Override
	public int updateByIdPC(StandarTaglibraryUpdateParam updateParam) {
            StandarTaglibraryEntity entity = updateParam.covert();
		int result = this.updateById(entity);
		return result;
	}
}
